package top.pmwly;

import java.util.Random;

/**
 * @author Herther
 * @version 1.0.0
 * @ClassName ArrayGenerate.java
 * @Description 数组生成
 * @createTime 2021年08月15日 15:55:00
 */
public class ArrayGenerate {

    private ArrayGenerate(){}

    public static Integer[] arrayGenerate(int n){
        Integer[] arr = new Integer[n];
        for (int k=0; k<n;k++){
             arr[k] =  k;
        }
        return arr;
    }

    /**
     * 随机数组
     * @param n
     * @param bound
     * @return
     */
    public static Integer[] randomGenerate(int n ,int bound){
        Integer arr[] = new Integer[n];
        for (int i=0;i<n;i++){
            arr[i] =  new Random().nextInt(bound);
        }
        return arr;
    }

}
